using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

using TrueCode.DependencyManager.BuildActions.Injection;


namespace TrueCode.DependencyManager.Services.InjectionPoints
{
  public class MethodsProviderCollection : IMethodProvider
  {
    private readonly IMethodProvider[] _providers;

    public MethodsProviderCollection( params IMethodProvider[] providers )
    {
      _providers = providers;
    }

    #region Implementation of IMethodsProvider
    public IEnumerable< MethodInfo > GetMethodsOf( Type type )
    {
      var result = Enumerable.Empty< MethodInfo >();
      foreach( var provider in _providers )
        result = result.Concat( provider.GetMethodsOf( type ) );
      return result;
    }
    #endregion
  }
}